meson: Generate babl.map based on export_symbols file
authorJan Vesely <jano.vesely@gmail.com>
Fri, 20 Jul 2018 05:55:54 +0000 (01:55 -0400)
committerØyvind Kolås <pippin@gimp.org>
Fri, 20 Jul 2018 15:14:27 +0000 (17:14 +0200)
Fixing issue #20

Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
babl.map [deleted file]
babl/meson.build
gen_babl_map.py [new file with mode: 0644]
meson.build

diff --git a/babl.map b/babl.map
deleted file mode 100644 (file)
index 348db8f..0000000
--- a/babl.map
+++ /dev/null
@@ -1,75 +0,0 @@
-V0_1_0 {
-    global:
-        babl_component;
-        babl_component_new;
-        babl_conversion_get_destination_space;
-        babl_conversion_get_source_space;
-        babl_conversion_new;
-        babl_cpu_accel_get_support;
-        babl_exit;
-        babl_fast_fish;
-        babl_fish;
-        babl_format;
-        babl_format_exists;
-        babl_format_get_bytes_per_pixel;
-        babl_format_get_model;
-        babl_format_get_n_components;
-        babl_format_get_space;
-        babl_format_get_type;
-        babl_format_has_alpha;
-        babl_format_is_format_n;
-        babl_format_is_palette;
-        babl_format_n;
-        babl_format_new;
-        babl_format_with_space;
-        babl_free;
-        babl_get_name;
-        babl_get_user_data;
-        babl_get_version;
-        babl_icc_make_space;
-        babl_icc_get_key;
-        babl_init;
-        babl_introspect;
-        babl_malloc;
-        babl_model;
-        babl_model_new;
-        babl_new_palette;
-        babl_palette_reset;
-        babl_palette_set_palette;
-        babl_process;
-        babl_process_rows;
-        babl_sampling;
-        babl_set_user_data;
-        babl_space;
-        babl_space_from_xyz;
-        babl_space_get_rgbtoxyz;
-        babl_space_to_xyz;
-        babl_ticks;
-        babl_type;
-        babl_type_new;
-        babl_space_to_icc;
-        babl_db_exist_by_name;
-        babl_db_find;
-        babl_db_init;
-        babl_db_exist_by_id;
-        babl_db_each;
-        babl_formats_count;
-        babl_format_class_for_each;
-        babl_model_class_for_each;
-        babl_type_class_for_each;
-        babl_conversion_class_for_each;
-        babl_set_extender;
-        babl_extension_quiet_log;
-        babl_fish_path;
-        babl_extender;
-        babl_class_name;
-        babl_sanity;
-        babl_type_is_symmetric;
-        babl_model_is_symmetric;
-        babl_fish_db;
-        babl_polynomial_approximate_gamma;
-        babl_backtrack;
-
-    local:
-        *;
-};
index 29ac00be8992a22b675a18d0093482c2e127237f..77e69a5dce0d1c34c4fdcdce0594f52bffcc6341 100644 (file)
@@ -1,6 +1,21 @@
 bablInclude = include_directories('.')
 subdir('base')
 
+version_script = 'babl.map'
+export_symbols = join_paths(meson.source_root(), 'export-symbols')
+version_script_target = custom_target(version_script,
+  input : [ export_symbols, ] ,
+  output: [ version_script ] ,
+  command: [
+  'python',
+  join_paths(meson.source_root(), 'gen_babl_map.py'),
+  export_symbols,
+  version_script,
+  ],
+  capture: true,
+)
+
+
 # Linker arguments
 babl_link_args = [
   '-Wl,--version-script,' + version_script,
@@ -116,6 +131,7 @@ babl = library(
   link_whole: [ babl_base, ],
   link_args: [ babl_link_args, ],
   dependencies: [ math, thread, dl, ],
+  link_depends: [ version_script_target, ],
   version: so_version,
   install: true,
 )
diff --git a/gen_babl_map.py b/gen_babl_map.py
new file mode 100644 (file)
index 0000000..644ea61
--- /dev/null
@@ -0,0 +1,11 @@
+import sys
+
+export_symbols=sys.argv[1]
+version_file=sys.argv[2]
+
+with open(export_symbols, 'r') as syms, \
+     open(version_file, 'w') as version:
+     version.write("V0_1_0 {\n    global:\n")
+     for sym in syms:
+        version.write("        {};\n".format(sym.strip()))
+     version.write("    local:\n        *;\n};\n")
index 956da0828416d662eded11940a71e516f23cceaa..31540d0acce3099fa0f613a8f46610e368f0db4d 100644 (file)
@@ -325,7 +325,6 @@ configure_file(
 # Subdirs
 
 rootInclude = include_directories('.')
-version_script = join_paths(meson.current_source_dir(), 'babl.map')
 
 subdir('babl')
 subdir('extensions')